package com.jpsl.core.reflection.property.f;

import com.jpsl.core.reflection.property.AccessException;
import com.jpsl.core.reflection.property.PropertyValueGetter;

import java.lang.reflect.Field;

/**
 *
 * @author 懒王猫
 */
class ByFieldPropertyValueGetter extends ByFieldPropertyAccessor implements PropertyValueGetter {

    public ByFieldPropertyValueGetter(String property, Field field) {
        super(property, field);
    }

    @Override
    public Object getValue(Object bean) throws AccessException {
        try {
            return field.get(bean);
        } catch (IllegalAccessException e) {
            throw new AccessException(e);
        }
    }

}
